home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 218
/
218.d81
/
t.c-64 f keys
< prev
next >
Wrap
Text File
|
2022-08-26
|
6KB
|
198 lines
u
EZ C-64 FUNCTION KEYS
Program and Text by James T. Jones
NOTE: EACH TIME A FUNCTION KEY IS
USED, THE SCREEN IS CLEARED TO DISPLAY
THE INFORMATION. IF IMPORTANT
INFORMATION IS ON THE SCREEN, USE ONE
OF THE SCREEN SAVER PROGRAMS ON
PREVIOUS ISSUES OF LOADSTAR BEFORE
PROCEEDING.
Our Beta Tester, Robin Harbron
reports: I got an "OUT OF MEMORY"
error when I hit F5 after doing some
of the other functions -- F7, F1, F3.
Seems F5 works when you first start
the program, but after doing a
directory, F5 produces the "? OUT OF
MEMORY ERROR".
We will try to find a fix and publish
it as soon as possible.
On Issue 46 of LOADSTAR, there is
a program, EASY KEYS, written by Steve
Goldsmith, that gives you the
capability to define the function
keys, F1 to F8, on the C-64 in a
manner similar to defining function
keys on its uncle, the C-128, by using
the KEY command.
During a programming session, it
is not unusual for me to encounter a
number of problems: disk drive errors,
the need to display the directory of a
diskette without losing the program in
memory, initializing the disk drive
when errors occur, displaying the disk
drive status, etc. Such problems are
readily handled, but not without a
great deal of typing. For example, in
the direct mode, one can type
CLOSE15:OPEN15,DV,15,"I":CLOSE15
(where DV is the device number of the
disk drive) and press RETURN to
initialize the disk drive.
It would be much easier if one
could simply press one of the function
keys to accomplish the same result.
In EASY KEYS, one types the
command string for each of the eight
function keys, F1 to F8. In this
manner, each function key can be
programmed to accomplish a given
result. For example, by pressing F4,
say, the status of the disk drive may
be displayed. A major drawback of
EASY KEYS, however, is that the
function key assignments cannot be
SAVEd, so that they are lost when the
C-64 is turned off. At the start of a
new programming session, the
assignments have to be typed
(tediously) again. Enter EZ C-64
FUNCTION KEYS!
LOAD and RUN the boot program,
B.C-64 F KEYS, to execute the BASIC
program, C-64 F KEYS.BAS. In the
latter program, the assignments of the
function keys are "hardcoded" in eight
lines. These assignments may be
readily changed by LISTing the program
and changing the strings, f$(1) to
f$(8), corresponding to F1 to F8,
respectively.
The operations obtained by press-
ing the various function keys are
discribed in the program. There is an
additional feature (an excellent
memory aid), available in the direct
mode, of displaying a summary of the
function key assignments by pressing
F7 or F8. In this case, use of
CHR$(17) (cursor down) in the
definitions of these function keys
assures that a carriage return
(CH$(13)) will not be executed on the
text line, thus avoiding a SYNTAX
error.
For each new set of function key
assignments, obtained by modifying
C-64 F KEYS.BAS, a different program
may be readily written and SAVEd. In
a specific case, a list of the
resulting file names and associated
definitions of the function keys would
be an aid to choosing the proper file
to be LOADed and RUN.
In EASY KEYS, a controlled input
subroutine, originally published by
Fender Tucker in one of his circulars,
is used to enter the command strings
corresponding to the function keys;
however, the length of each string is
limited to 38 characters, including
control characters such as a carriage
return (chr$(13)). In the present
program, the maximum length of each
command string is increased to 78
characters, so that much more
flexibility is available for the
function key assignments. Of course,
the main advantage of using EZ C-64
FUNCTION KEYS is that the definitions
can be SAVEd and reLOADed for the next
programming session, thus avoiding
much repetitive typing.
In EASY KEYS, as in the present
program, the range of addresses from
49408 onward is used as a buffer to
store the data associated with the
function key assignments. Caution
should be observed in using this range
of addresses for other purposes. Two
object files, NEW DIR(52736).O and ERR
MSG(53120).O, are BLOADed in the
present program; however, their ranges
of addresses do not overlap with the
range of addresses of the buffer.
The object file, EZ F KEYS.O, is
used to lessen the time to access the
data, in much the same manner as the
keyboard buffer or queue (beginning at
address 631) is used in the boot file,
B.C-64 F KEYS, to LOAD and RUN the
BASIC program, C-64 F KEYS.BAS. The
source file, EZ F KEYS.S, cor-
responding to the object file, is on
this diskette. The format of the
MERLIN assembler is used.
I haven't "hacked" the C-128 KEY
command to any extent. It may be that
an effort in this direction would
yield useful information for
reformulating a C-64 program for
defining the C-64 function keys. In
the meantime, you may find EZ C-64
FUNCTION KEYS a useful adjunct to your
programming.
NOTE: Actually, when the KEY command
is used, the maximum length for all
the definitions of function keys
together is 241 characters for the
C-128, whereas in this program the
maximum is 8*78=624, so that more
flexibility is available. Of course,
with the C-128 the function keys may
be readily redefined in a program "on
the run", so to speak. For example,
the LINE,
10 KEY 2, "PRINT DS$" + CHR$(13)
tells the C-128 to check and display
the disk drive error channel
variables each time the F2 function
key is pressed.
JJ
DAVE'S NOTE: Dig into the Source File
and learn how the magic is done!
Thanks to Dr. Jack for climbing into
so many older programs and bringing
them into the 21st Century!
DMM